//
//  YYJLExchangeCell.m
//  YuanyangJinlou
//
//  Created by mac004 on 2017/1/12.
//  Copyright © 2017年 suli19910309@qq.com. All rights reserved.
//

#import "YYJLExchangeCell.h"
@interface YYJLExchangeCell(){
    UILabel     * time;//兑换时间
    UIImageView * showPic;//图片
    UILabel     * title;//名称
    UILabel     * status;//状态
    UILabel     * integral;//所需积分
    UILabel     * original;//原始积分
    
}
@end
@implementation YYJLExchangeCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self =[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self creatUI];
    }
    return  self;
}
-(void)creatUI{
    UIView * bgView=[[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 175*PER_HEIGHT)];
    bgView.backgroundColor=WHITE_COLOR;
    [self.contentView addSubview:bgView];
    
    time=[MyControl createLabelWithFrame:CGRectMake(12*PER_WIDTH, 18*PER_HEIGHT, bgView.width-24*PER_WIDTH, 12*PER_HEIGHT) Font:12 Text:@"兑换时间: 2016-10-25  15:03" Color:FEELT_COLOR];
    [bgView addSubview:time];
    
    //分割线
    UIView * line1=[[UIView alloc]initWithFrame:CGRectMake(time.left, time.bottom+10*PER_HEIGHT, bgView.width-24*PER_WIDTH, 0.5)];
    line1.backgroundColor=UIColorFromHex(0xcccccc);
    [bgView addSubview:line1];
    
    showPic =[[UIImageView alloc]initWithFrame:CGRectMake(time.left, line1.bottom+10*PER_HEIGHT, 110*PER_WIDTH, 110*PER_WIDTH)];
    showPic.image=[UIImage imageNamed:@"img_shangpin2"];
    [bgView addSubview:showPic];
    
    title=[MyControl createLabelWithFrame:CGRectMake(showPic.right+15*PER_WIDTH, showPic.top, SCREEN_WIDTH-showPic.right-27*PER_WIDTH, 14*PER_HEIGHT) Font:14 Text:@"邹奥背锅侠1号我是二号" Color:BLACK_COLOR];
    [bgView addSubview:title];
    
    status=[MyControl createLabelWithFrame:CGRectMake(title.left, title.bottom+10*PER_HEIGHT, title.width, 12*PER_HEIGHT) Font:12 Text:@"申请中" Color:FEELT_COLOR];
    [bgView addSubview:status];
    
    UIImage * jifen =[UIImage imageNamed:@"ico_jinfen3"];//16*16
    UIImageView * jifenview=[[UIImageView alloc]initWithFrame:CGRectMake(title.left, status.bottom+36*PER_HEIGHT, 16*PER_WIDTH, 16*PER_WIDTH)];
    jifenview.image=jifen;
    [bgView addSubview:jifenview];
    
    integral=[MyControl createLabelWithFrame:CGRectMake(jifenview.right+5*PER_WIDTH, jifenview.top, 100, 16*PER_HEIGHT) Font:16 Text:@"100" Color:TINK_COLOR];
    integral.font=[UIFont fontWithName:HLT size:16*PER_HEIGHT];
    [bgView addSubview:integral];
    
    original=[MyControl createLabelWithFrame:CGRectMake(jifenview.left+5*PER_WIDTH, jifenview.bottom+15*PER_HEIGHT, 50, 12*PER_HEIGHT) Font:12 Text:@"120" Color:FEELT_COLOR];
    [bgView addSubview:original];
    
    UIView * line2=[[UIView alloc]initWithFrame:CGRectMake(jifenview.left, original.top+original.height/2, original.width+10, 0.5)];
    line2.backgroundColor=UIColorFromHex(0xcccccc);
    [bgView addSubview:line2];
}
@end
